<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>TMDb电影刮削器 - Tkinter样式</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', 'SimSun', Arial, sans-serif;
            background: #f0f0f0;
            padding: 10px;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: #f0f0f0;
            border: 2px solid #d0d0d0;
            display: flex;
            flex-direction: column;
        }

        .header {
            background: #e1e1e1;
            padding: 8px 12px;
            border-bottom: 1px solid #c0c0c0;
            font-size: 14px;
            font-weight: bold;
            color: #333;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .window-controls {
            display: flex;
            gap: 5px;
        }

        .control-btn {
            width: 16px;
            height: 16px;
            border: 1px solid #999;
            background: #e1e1e1;
            font-size: 10px;
            cursor: pointer;
            text-align: center;
            line-height: 14px;
        }

        .control-btn:hover {
            background: #d1d1d1;
        }

        /* 文件选择器区域 */
        .file-selector-section {
            padding: 10px;
            background: #f0f0f0;
            border-bottom: 1px solid #d0d0d0;
        }

        .file-selector-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .file-selector-row label {
            font-size: 12px;
            color: #333;
            min-width: 80px;
        }

        .file-input {
            flex: 1;
            padding: 4px 6px;
            border: 2px inset #f0f0f0;
            background: white;
            font-size: 12px;
            height: 24px;
        }

        .browse-btn {
            background: #e1e1e1;
            border: 2px outset #e1e1e1;
            padding: 4px 12px;
            font-size: 12px;
            cursor: pointer;
            height: 24px;
            min-width: 60px;
        }

        .browse-btn:hover {
            background: #d1d1d1;
        }

        .browse-btn:active {
            border: 2px inset #e1e1e1;
        }

        /* 主要布局区域 */
        .main-layout {
            display: flex;
            min-height: 600px;
        }

        /* 左侧功能面板 */
        .left-panel {
            width: 320px;
            background: #f0f0f0;
            border-right: 1px solid #d0d0d0;
            display: flex;
            flex-direction: column;
        }

        /* 核心流程区域 */
        .core-process {
            flex: 1;
            padding: 10px;
        }

        .section-frame {
            border: 2px groove #f0f0f0;
            margin-bottom: 10px;
            background: #f0f0f0;
        }

        .section-title {
            background: #f0f0f0;
            padding: 4px 8px;
            font-size: 12px;
            font-weight: bold;
            color: #333;
            border-bottom: 1px solid #d0d0d0;
        }

        .section-content {
            padding: 8px;
        }

        .step-button {
            width: 100%;
            background: #e1e1e1;
            border: 2px outset #e1e1e1;
            padding: 8px 12px;
            font-size: 12px;
            cursor: pointer;
            margin-bottom: 6px;
            text-align: left;
            color: #333;
        }

        .step-button:hover {
            background: #d1d1d1;
        }

        .step-button:active {
            border: 2px inset #e1e1e1;
        }

        .step-description {
            font-size: 11px;
            color: #666;
            margin-bottom: 6px;
            padding-left: 4px;
        }

        .checkbox-group {
            margin: 6px 0;
            padding-left: 4px;
        }

        .checkbox-item {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 4px;
        }

        .checkbox-item input[type="checkbox"] {
            width: 13px;
            height: 13px;
        }

        .checkbox-item label {
            font-size: 11px;
            color: #333;
            cursor: pointer;
        }

        .progress-container {
            margin: 6px 0;
            padding-left: 4px;
        }

        .progress-bar {
            width: 100%;
            height: 20px;
            border: 2px inset #f0f0f0;
            background: white;
            position: relative;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: #316AC5;
            width: 100%;
            transition: width 0.3s ease;
        }

        .progress-text {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 10px;
            color: #333;
            z-index: 1;
        }

        .status-text {
            font-size: 10px;
            color: #666;
            margin-top: 4px;
            padding-left: 4px;
        }

        /* 辅助工具区域 */
        .helper-tools {
            background: #f0f0f0;
            border-top: 1px solid #d0d0d0;
        }

        .helper-button {
            width: 100%;
            background: #e1e1e1;
            border: 2px outset #e1e1e1;
            padding: 8px 12px;
            font-size: 12px;
            cursor: pointer;
            margin-bottom: 6px;
            text-align: left;
        }

        .helper-button:hover {
            background: #d1d1d1;
        }

        .helper-button:active {
            border: 2px inset #e1e1e1;
        }

        .helper-description {
            font-size: 10px;
            color: #666;
            margin-bottom: 6px;
            padding-left: 4px;
        }

        /* 右侧内容区域 */
        .right-panel {
            flex: 1;
            background: #f0f0f0;
            display: flex;
            flex-direction: column;
        }

        /* 标签页 */
        .notebook-container {
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .tab-header {
            display: flex;
            background: #f0f0f0;
            border-bottom: 1px solid #d0d0d0;
        }

        .tab-button {
            padding: 6px 16px;
            background: #e1e1e1;
            border: 2px outset #e1e1e1;
            border-bottom: none;
            font-size: 12px;
            cursor: pointer;
            margin-right: 2px;
        }

        .tab-button.active {
            background: #f0f0f0;
            border: 2px inset #f0f0f0;
            border-bottom: 2px solid #f0f0f0;
        }

        .tab-button:hover:not(.active) {
            background: #d1d1d1;
        }

        /* 标签页内容 */
        .tab-content {
            flex: 1;
            background: #f0f0f0;
            border: 2px inset #f0f0f0;
            margin: 0 10px 10px 10px;
        }

        .tab-pane {
            display: none;
            padding: 8px;
            height: 100%;
            overflow: auto;
        }

        .tab-pane.active {
            display: block;
        }

        /* 电影列表 */
        .listbox-container {
            height: 400px;
            border: 2px inset #f0f0f0;
            background: white;
            overflow: auto;
        }

        .movie-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 11px;
        }

        .movie-table th {
            background: #e1e1e1;
            padding: 4px 6px;
            text-align: left;
            border-bottom: 1px solid #c0c0c0;
            font-size: 11px;
            font-weight: bold;
            position: sticky;
            top: 0;
        }

        .movie-table td {
            padding: 3px 6px;
            border-bottom: 1px solid #e0e0e0;
        }

        .movie-table tr:nth-child(even) {
            background: #f8f8f8;
        }

        .movie-table tr:hover {
            background: #e0e0ff;
        }

        .movie-link {
            color: #0000ff;
            text-decoration: underline;
            font-size: 10px;
        }

        /* 日志区域 */
        .log-container {
            height: 400px;
            border: 2px inset #f0f0f0;
            background: black;
            color: #00ff00;
            font-family: 'Courier New', monospace;
            font-size: 11px;
            padding: 4px;
            overflow-y: auto;
            white-space: pre-wrap;
        }

        /* 底部状态栏 */
        .bottom-status {
            background: #e1e1e1;
            padding: 4px 8px;
            border-top: 1px solid #c0c0c0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 11px;
        }

        .status-left {
            color: #333;
        }

        .bottom-buttons {
            display: flex;
            gap: 4px;
        }

        .bottom-btn {
            padding: 3px 8px;
            border: 2px outset #e1e1e1;
            background: #e1e1e1;
            font-size: 11px;
            cursor: pointer;
        }

        .bottom-btn:hover {
            background: #d1d1d1;
        }

        .bottom-btn:active {
            border: 2px inset #e1e1e1;
        }

        /* 滚动条样式（模拟tkinter） */
        ::-webkit-scrollbar {
            width: 16px;
            height: 16px;
        }

        ::-webkit-scrollbar-track {
            background: #f0f0f0;
            border: 1px solid #c0c0c0;
        }

        ::-webkit-scrollbar-thumb {
            background: #c0c0c0;
            border: 1px outset #c0c0c0;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: #b0b0b0;
        }

        ::-webkit-scrollbar-corner {
            background: #f0f0f0;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 顶部标题栏 -->
        <div class="header">
            <span>TMDb电影刮削器</span>
            <div class="window-controls">
                <button class="control-btn minimize">-</button>
                <button class="control-btn maximize">□</button>
                <button class="control-btn close">×</button>
            </div>
        </div>

        <!-- 文件选择器区域 -->
        <div class="file-selector-section">
            <div class="file-selector-row">
                <label>电影文件夹:</label>
                <input type="text" class="file-input" value="D:\我的电影收藏">
                <button class="browse-btn">浏览...</button>
            </div>
        </div>

        <!-- 主要布局区域 -->
        <div class="main-layout">
            <!-- 左侧功能面板 -->
            <div class="left-panel">
                <!-- 核心流程 -->
                <div class="core-process">
                    <div class="section-frame">
                        <div class="section-title">核心流程</div>
                        <div class="section-content">
                            <!-- 步骤1 -->
                            <button class="step-button">① 整理电影文件</button>
                            <div class="step-description">将每个视频放入独立的同名文件夹</div>
                            <div class="progress-container">
                                <div class="progress-bar">
                                    <div class="progress-fill"></div>
                                    <div class="progress-text">整理完成 (0/0)</div>
                                </div>
                            </div>

                            <!-- 步骤2 -->
                            <button class="step-button">② 爬取TMDb链接</button>
                            <div class="checkbox-group">
                                <div class="checkbox-item">
                                    <input type="checkbox" id="rebuild">
                                    <label for="rebuild">重新扫描所有电影（忽略已有）</label>
                                </div>
                            </div>
                            <div class="progress-container">
                                <div class="progress-bar">
                                    <div class="progress-fill"></div>
                                    <div class="progress-text">收集完成，可以对电影列表进行编辑</div>
                                </div>
                            </div>

                            <!-- 步骤3 -->
                            <button class="step-button">③ 爬取电影信息与海报</button>
                            <div class="checkbox-group">
                                <div class="checkbox-item">
                                    <input type="checkbox" id="overwriteNfo">
                                    <label for="overwriteNfo">覆盖已存在的NFO文件</label>
                                </div>
                                <div class="checkbox-item">
                                    <input type="checkbox" id="downloadImages" checked>
                                    <label for="downloadImages">下载海报与同人画</label>
                                </div>
                            </div>
                            <div class="progress-container">
                                <div class="progress-bar">
                                    <div class="progress-fill"></div>
                                    <div class="progress-text">生成完成，可以在KODI中添加视频了</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 辅助工具 -->
                <div class="helper-tools">
                    <div class="section-frame">
                        <div class="section-title">辅助工具</div>
                        <div class="section-content">
                            <button class="helper-button">下载海报（根据NFO）</button>
                            <div class="helper-description">根据文件夹内所有的NFO文件补充下载海报</div>
                            <div class="progress-container">
                                <div class="progress-bar">
                                    <div class="progress-fill"></div>
                                    <div class="progress-text">下载完成</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 右侧内容区域 -->
            <div class="right-panel">
                <div class="notebook-container">
                    <!-- 标签页头部 -->
                    <div class="tab-header">
                        <button class="tab-button active" data-tab="movie-list">电影列表</button>
                        <button class="tab-button" data-tab="process-log">处理日志</button>
                    </div>

                    <!-- 标签页内容 -->
                    <div class="tab-content">
                        <!-- 电影列表标签页 -->
                        <div class="tab-pane active" id="movie-list">
                            <div class="listbox-container">
                                <table class="movie-table">
                                    <thead>
                                        <tr>
                                            <th style="width: 40px;">序号</th>
                                            <th style="width: 200px;">电影名称</th>
                                            <th>TMDb链接</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td>1</td>
                                            <td>星际穿越 (2014)</td>
                                            <td><a href="https://www.themoviedb.org/movie/157336" class="movie-link">https://www.themoviedb.org/movie/157336</a></td>
                                        </tr>
                                        <tr>
                                            <td>2</td>
                                            <td>盗梦空间 (2010)</td>
                                            <td><a href="https://www.themoviedb.org/movie/27205" class="movie-link">https://www.themoviedb.org/movie/27205</a></td>
                                        </tr>
                                        <tr>
                                            <td>3</td>
                                            <td>肖申克的救赎 (1994)</td>
                                            <td><a href="https://www.themoviedb.org/movie/278" class="movie-link">https://www.themoviedb.org/movie/278</a></td>
                                        </tr>
                                        <tr>
                                            <td>4</td>
                                            <td>阿甘正传 (1994)</td>
                                            <td><a href="https://www.themoviedb.org/movie/13" class="movie-link">https://www.themoviedb.org/movie/13</a></td>
                                        </tr>
                                        <tr>
                                            <td>5</td>
                                            <td>霸王别姬 (1993)</td>
                                            <td><a href="https://www.themoviedb.org/movie/10419" class="movie-link">https://www.themoviedb.org/movie/10419</a></td>
                                        </tr>
                                        <tr>
                                            <td>6</td>
                                            <td>机器人总动员 (2008)</td>
                                            <td><a href="https://www.themoviedb.org/movie/10681" class="movie-link">https://www.themoviedb.org/movie/10681</a></td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>

                        <!-- 处理日志标签页 -->
                        <div class="tab-pane" id="process-log">
                            <div class="log-container" id="log-text">根据NFO文件下载海报完成！
统计：成功 0 个，共跳过 4 个
海报下载完成！
目录检查与目录类型不匹配
清单文件与目录不一致：目录4部，清单5部
开始处理电影：星际穿越
下载NFO信息成功
下载海报成功
下载同人画成功
处理完成</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 底部状态栏 -->
        <div class="bottom-status">
            <div class="status-left">就绪</div>
            <div class="bottom-buttons">
                <button class="bottom-btn">重置</button>
                <button class="bottom-btn">打开电影清单文件</button>
                <button class="bottom-btn">打开错误日志文件</button>
                <button class="bottom-btn">使用说明</button>
            </div>
        </div>
    </div>

    <script>
        // 标签页切换功能
        document.querySelectorAll('.tab-button').forEach(button => {
            button.addEventListener('click', function() {
                const tabId = this.getAttribute('data-tab');
                
                // 移除所有活动状态
                document.querySelectorAll('.tab-button').forEach(btn => btn.classList.remove('active'));
                document.querySelectorAll('.tab-pane').forEach(pane => pane.classList.remove('active'));
                
                // 激活当前标签
                this.classList.add('active');
                document.getElementById(tabId).classList.add('active');
            });
        });

        // 步骤按钮点击事件
        document.querySelectorAll('.step-button').forEach(button => {
            button.addEventListener('click', function() {
                // 模拟处理过程
                console.log('执行步骤:', this.textContent);
            });
        });

        // 文件浏览功能
        document.querySelector('.browse-btn').addEventListener('click', function() {
            alert('请选择电影文件夹');
        });

        // 底部按钮功能
        document.querySelectorAll('.bottom-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                console.log('点击按钮:', this.textContent);
            });
        });

        // 窗口控制按钮
        document.querySelector('.close').addEventListener('click', () => {
            if(confirm('确定要关闭程序吗？')) {
                window.close();
            }
        });
    </script>
</body>
</html>